package org.example.JUC;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class ThreadPoolExecutorDemo {
    private static ThreadPoolExecutor threadPoolExecutor;
    private static int count=0;

    static{
        threadPoolExecutor=new ThreadPoolExecutor(
                3,
                5,
                10,
                TimeUnit.MILLISECONDS,
                new LinkedBlockingDeque<>(),
        new ThreadPoolExecutor.AbortPolicy());
    }
    public static void execute(Runnable task){
        threadPoolExecutor.execute(task);
    }
}
